[IA64] added multicall
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 9 Feb 2006 15:48:47 +0000 (08:48 -0700)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 9 Feb 2006 15:48:47 +0000 (08:48 -0700)
This patch added multicall hypercall.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
xen/arch/ia64/xen/hypercall.c
xen/include/asm-ia64/multicall.h

index 34ebd0b355710ac2e4d88ada73dfc7e69fd69c80..355fbd6b7eae57e3fba0c7b63732e8c9fda03bae 100644 (file)
@@ -9,6 +9,7 @@
 #include <xen/config.h>
 #include <xen/sched.h>
 #include <xen/hypercall.h>
+#include <xen/multicall.h>
 
 #include <linux/efi.h> /* FOR EFI_UNIMPLEMENTED */
 #include <asm/sal.h>   /* FOR struct ia64_sal_retval */
@@ -23,6 +24,42 @@ extern unsigned long translate_domain_mpaddr(unsigned long);
 unsigned long idle_when_pending = 0;
 unsigned long pal_halt_light_count = 0;
 
+hypercall_t ia64_hypercall_table[] =
+       {
+       (hypercall_t)do_ni_hypercall,           /* do_set_trap_table */         /*  0 */
+       (hypercall_t)do_ni_hypercall,           /* do_mmu_update */
+       (hypercall_t)do_ni_hypercall,           /* do_set_gdt */
+       (hypercall_t)do_ni_hypercall,           /* do_stack_switch */
+       (hypercall_t)do_ni_hypercall,           /* do_set_callbacks */
+       (hypercall_t)do_ni_hypercall,           /* do_fpu_taskswitch */         /*  5 */
+       (hypercall_t)do_ni_hypercall,           /* do_sched_op */
+       (hypercall_t)do_dom0_op,
+       (hypercall_t)do_ni_hypercall,           /* do_set_debugreg */
+       (hypercall_t)do_ni_hypercall,           /* do_get_debugreg */
+       (hypercall_t)do_ni_hypercall,           /* do_update_descriptor */      /* 10 */
+       (hypercall_t)do_ni_hypercall,           /* do_ni_hypercall */
+       (hypercall_t)do_memory_op,
+       (hypercall_t)do_multicall,
+       (hypercall_t)do_ni_hypercall,           /* do_update_va_mapping */
+       (hypercall_t)do_ni_hypercall,           /* do_set_timer_op */           /* 15 */
+       (hypercall_t)do_event_channel_op,
+       (hypercall_t)do_xen_version,
+       (hypercall_t)do_console_io,
+       (hypercall_t)do_ni_hypercall,           /* do_physdev_op */
+       (hypercall_t)do_grant_table_op,                                         /* 20 */
+       (hypercall_t)do_ni_hypercall,           /* do_vm_assist */
+       (hypercall_t)do_ni_hypercall,           /* do_update_va_mapping_otherdomain */
+       (hypercall_t)do_ni_hypercall,           /* (x86 only) */
+       (hypercall_t)do_ni_hypercall,           /* do_vcpu_op */
+       (hypercall_t)do_ni_hypercall,           /* (x86_64 only) */             /* 25 */
+       (hypercall_t)do_ni_hypercall,           /* do_mmuext_op */
+       (hypercall_t)do_ni_hypercall,           /* do_acm_op */
+       (hypercall_t)do_ni_hypercall,           /* do_nmi_op */
+       (hypercall_t)do_ni_hypercall,           /*  */
+       (hypercall_t)do_ni_hypercall,           /*  */                          /* 30 */
+       (hypercall_t)do_ni_hypercall            /*  */
+       };
+
 int
 ia64_hypercall (struct pt_regs *regs)
 {
@@ -181,9 +218,13 @@ ia64_hypercall (struct pt_regs *regs)
                regs->r8 = do_xen_version(regs->r14, regs->r15);
                break;
 
+           case __HYPERVISOR_multicall:
+               regs->r8 = do_multicall(regs->r14, regs->r15);
+               break;
+
            default:
                printf("unknown hypercall %x\n", regs->r2);
-               regs->r8 = (unsigned long)-1;
+               regs->r8 = do_ni_hypercall();
        }
        return 1;
 }
index 8e7953bece1b0332c62cbbbd960312e17ce8a43b..53bb171c326dbfe711d08eed37be17046d8fff00 100644 (file)
@@ -1,5 +1,27 @@
 #ifndef __ASM_IA64_MULTICALL_H__
 #define __ASM_IA64_MULTICALL_H__
 
-#define do_multicall_call(_call) BUG()
+#include <public/xen.h>
+
+typedef unsigned long (*hypercall_t)(
+                       unsigned long arg0,
+                       unsigned long arg1,
+                       unsigned long arg2,
+                       unsigned long arg3,
+                       unsigned long arg4,
+                       unsigned long arg5);
+
+extern hypercall_t ia64_hypercall_table[];
+
+static inline void do_multicall_call(multicall_entry_t *call)
+{
+       call->result = (*ia64_hypercall_table[call->op])(
+                       call->args[0],
+                       call->args[1],
+                       call->args[2],
+                       call->args[3],
+                       call->args[4],
+                       call->args[5]);
+}
+
 #endif /* __ASM_IA64_MULTICALL_H__ */